feat(fields): add fast Mersenne31 arithmetic - #257
Conversation
🤖 PR SummaryOverviewThis PR restructures the Mersenne31 field implementation and adds a fast, Restructuring
Mathematical Formalization
Fast Arithmetic Implementation
No Statistics
Lean Declarations ✏️ Removed: 3 declaration(s)
✏️ Added: 108 declaration(s)
📋 **Additional Analysis**The diff implements a significant refactoring/improvement (replacing the single 📄 **Per-File Summaries**
Last updated: 2026-07-20 08:30 UTC. |
MavenRain
left a comment
There was a problem hiding this comment.
A couple of things:
- Consider adding tests for
Mersenne31.Fast - Mersenne.lean is still referenced in the docs. Consider updating.
- Consider extracting the four
haveblocks duplicated betweenreduceUInt64_castandreduceUInt64Raw_ltinto a private lemma.
dhsorens
left a comment
There was a problem hiding this comment.
Summary
Solid Fast track: Mersenne reduction (not Montgomery) is the right call for 2^31-1, and the toField_* / ringEquiv / inv addition-chain proofs are in good shape.
Blockers before merge: green CI, rebase onto current main, and a #guard test file matching BabyBear/KoalaBear Fast.
Inline notes are the actionable items.
8b16d84 to
3f3e409
Compare
🤖 PR SummaryThis pull request adds a fully formalized and verified implementation of the Mersenne31 prime field (2^31 - 1) for use in Circle STARKs, along with a fast UInt32-backed representation, a refactored module structure with backward compatibility, and comprehensive test coverage. The core changes are in the new Statistics
Lean Declarations ✏️ Removed: 3 declaration(s)
✏️ Added: 107 declaration(s)
📄 **Per-File Summaries**
Last updated: 2026-09-01 18:55 UTC. |
dhsorens
left a comment
There was a problem hiding this comment.
All requested review changes are addressed. The generated compatibility import is restored, and local build, tests, style lint, documentation integrity, and import validation pass on the merged-main head.
|
thanks @varunthakore for the contribution! |
No description provided.